﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace YasharEl.Infrastructure.ObjectFactory.Adapters
{
    [Serializable]
    public class TypeMappingException : Exception
    {
        public TypeMappingException(Type sourceType, Type targetType, string message)
            :base(string.Format("Invalid type mapping from {0} to {1}. Error message : {2}.", 
                sourceType.FullNameToString(), targetType.FullNameToString(), message))
        {
        }

        protected TypeMappingException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}
